<?php
/**
 * @package framework
 * @subpackage views
 *
 * @author Philippe Archambault <philippe.archambault@gmail.com>
 * @version 0.1
 * @license http://www.gnu.org/licenses/gpl.html GPL License
 * @copyright Philippe Archambault, 2008
 */
?>
<h1><?php echo __(ucfirst($action).' location'); ?></h1>

<form action="<?php echo $action=='edit' ? get_url('location/edit/'.$location->id): get_url('location/add'); ; ?>" method="post">
  <table class="fieldset" cellpadding="0" cellspacing="0" border="0">
    <tr>

      <td class="label"><label for="location_name"><?php echo __('Name'); ?></label></td>
      <td class="field"><input class="textbox" id="location_name" maxlength="100" name="location[name]" size="100" type="text" value="<?php echo $location->name; ?>" /></td>
      <td class="help"><?php echo __('Required.'); ?></td>
    </tr>
  </table>

  <p class="buttons">
    <input class="button" name="commit" type="submit" accesskey="s" value="<?php echo __('Save'); ?>" />
    <?php echo __('or'); ?> <a href="<?php echo (AuthUser::hasPermission('administrator')) ? get_url('location') : get_url(); ?>"><?php echo __('Cancel'); ?></a>
  </p>

</form>

<script type="text/javascript">
// <![CDATA[
Field.activate('location_name');
// ]]>
</script>
